package com.chengwt.dao.impl;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.chengwt.entity.Paper;
import com.chengwt.entity.Questions;
import com.chengwt.util.HibernateUtil;

public class QuestionsPaperTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Session session =HibernateUtil.getSession();
		Transaction tx = session.beginTransaction();
		Paper p =new Paper();
		Questions q = new Questions();
		try {
			p.setPaperId(3);
			q.setQuestionsAnswer("123");
			
		session.save(p);
		session.save(q);
		
	
		
		tx.commit();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
